<div class="row">
  <div id="breadcrumb" class="col-md-12">
    <ol class="breadcrumb">
      <li><a ui-sref="layout.main">主页</a></li>
      <li><a ui-sref="layout.list.usr">用户列表</a></li>
      <li><a href="javascript:;">用户详细信息</a></li>
    </ol>
  </div>
</div>
<div class="well" style="background-color: #FFFFFF;">
  <div class="row">
    <div class="col-xs-12">
      <h3 ng-bind="user.usr_name">用户详情</h3>
    </div>
  </div>
  <hr />
  <div class="row">
    <div class="col-xs-12">
      <form class="form-horizontal">
        <div class="form-group">
          <label class="col-sm-2 control-label">id</label>
          <div class="col-sm-10">
            <input type="text" ng-model="user.id" class="form-control" ng-disabled="true">
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">姓名</label>
          <div class="col-sm-10">
            <input type="text" ng-model="user.usr_name" class="form-control" ng-disabled="update">
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">学号</label>
          <div class="col-sm-10">
            <input type="text" ng-model="user.usr_num" class="form-control" ng-disabled="update">
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">班级</label>
          <div class="col-sm-10">
            <!-- <input type="text" ng-model="user.usr_classes" class="form-control" ng-disabled="update"> -->
            <ui-select ng-model="user.usr_classes" theme="select2" ng-disabled="update" style="min-width: 100%;">
              <ui-select-match>
                {{$select.selected.classes_name}}
              </ui-select-match>
              <ui-select-choices repeat="classesItem.id as classesItem in classes | filter : {classes_name : $select.search}">
                <div ng-bind-html="classesItem.classes_name | highlight: $select.search"></div>
                <!--
                <small>
                  email: {{person.email}}
                  age: <span ng-bind-html="''+person.age | highlight: $select.search"></span>
                </small>
                -->
              </ui-select-choices>
            </ui-select>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">性别</label>
          <div class="col-sm-10">
            <!-- <input type="text" ng-model="user.usr_sex" class="form-control" ng-disabled="update"> -->
            <ui-select ng-model="user.usr_sex" theme="select2" ng-disabled="update" style="min-width: 100%;">
              <ui-select-match>
                {{$select.selected}}
              </ui-select-match>
              <ui-select-choices repeat="sexItem in ['男','女'] | filter : $select.search">
                <div ng-bind-html="sexItem | highlight: $select.search"></div>
                <!--
                <small>
                  email: {{person.email}}
                  age: <span ng-bind-html="''+person.age | highlight: $select.search"></span>
                </small>
                -->
              </ui-select-choices>
            </ui-select>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">楼栋号</label>
          <div class="col-sm-10">
            <input type="text" ng-model="user.usr_building" class="form-control" ng-disabled="update">
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">寝室号</label>
          <div class="col-sm-10">
            <input type="text" ng-model="user.usr_room" class="form-control" ng-disabled="update">
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">床位号</label>
          <div class="col-sm-10">
            <input type="text" ng-model="user.usr_bed" class="form-control" ng-disabled="update">
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">手机号</label>
          <div class="col-sm-10">
            <input type="text" ng-model="user.usr_mobile" class="form-control" ng-disabled="update">
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">邮箱</label>
          <div class="col-sm-10">
            <input type="email" ng-model="user.usr_email" class="form-control" ng-disabled="update">
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">生日</label>
          <div class="col-sm-10">
            <!-- <input type="text" ng-model="user.usr_birth" class="form-control" ng-disabled="update"> -->
            <p class="input-group">
              <input type="text"
                    class="form-control"
                    uib-datepicker-popup="yyyy-MM-dd"
                    ng-model="tempUsrBirth"
                    ng-disabled="update"
                    datepicker-options="dateOptions"
                    close-text="关闭"
                    clear-text="清除"
                    is-open="opened" />
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="opened = !opened"><i class="glyphicon glyphicon-calendar"></i></button>
              </span>
            </p>
          </div>
        </div>

        <div class="form-group" ng-if="user.usr_status != 1">
          <label class="col-sm-2 control-label">角色</label>
          <div class="col-sm-10">
            <!-- <input type="text" ng-model="user.usr_role" class="form-control" ng-disabled="update"> -->
            <ui-select ng-model="user.usr_role" theme="select2" ng-disabled="update" style="min-width: 100%;">
              <ui-select-match>
                {{$select.selected.role_name}}
              </ui-select-match>
              <ui-select-choices repeat="roleItem.id as roleItem in role| filter : {role_name : $select.search}">
                <div ng-bind-html="roleItem.role_name | highlight: $select.search"></div>
              </ui-select-choices>
            </ui-select>
          </div>
        </div>
        <div class="form-group" ng-if="user.usr_status != 1">
          <label class="col-sm-2 control-label">部门</label>
          <div class="col-sm-10">
            <!-- <input type="text" ng-model="user.usr_dept" class="form-control" ng-disabled="update"> -->
            <ui-select ng-model="user.usr_dept" theme="select2" ng-disabled="update" style="min-width: 100%;">
              <ui-select-match>
                {{$select.selected.dept_name}}
              </ui-select-match>
              <ui-select-choices repeat="deptItem.id as deptItem in dept| filter : {dept_name : $select.search}">
                <div ng-bind-html="deptItem.dept_name | highlight: $select.search"></div>
              </ui-select-choices>
            </ui-select>
          </div>
        </div>
        <div class="form-group" ng-if="user.usr_status != 1">
          <label class="col-sm-2 control-label">用户描述</label>
          <div class="col-sm-10">
            <!-- <input type="text" ng-model="user.usr_desc" class="form-control" ng-disabled="update"> -->
            <textarea ng-model="user.usr_desc" class="form-control" ng-disabled="update" rows="3"></textarea>
          </div>
        </div>
        <div class="form-group">
          <div class="col-xs-2"></div>
          <div class="col-xs-2">
            <button class="btn btn-block btn-success" ng-click="modify()" ng-if="!update">确认修改</button>
          </div>
          <div class="col-xs-2">
            <input class="btn btn-block btn-danger" ng-click="toggleUpdate()" type="button" ng-if="!update" value="取消" />
          </div>
        </div>
      </form>
    </div>
  </div>
  <!-- 是否学生会成员
    1 表示不是
    2 表示是学生会成员
    3 表示是学生会成员但已经毕业或退役 -->
  <div class="row">
    <div class="col-xs-3" ng-if="user.usr_status != 3">
      <input class="btn btn-block btn-info" ng-click="toggleUpdate()" type="button" ng-if="update" value="点击修改" />
    </div>
    <div class="col-xs-3" ng-if="user.usr_status == 1">
      <input class="btn btn-block btn-success" ng-click="setMenber(2)" type="button" ng-if="update" value="设置为学生会成员" />
    </div>
    <div class="col-xs-3" ng-if="user.usr_status == 2">
      <input class="btn btn-block btn-danger" ng-click="setMenber(1)" type="button" ng-if="update" value="取消学生会成员资格" />
    </div>
    <div class="col-xs-3" ng-if="user.usr_status == 2">
      <input class="btn btn-block btn-warning" ng-click="setMenber(3)" type="button" ng-if="update" value="成员退役" />
    </div>
  </div>
</div>
